package com.duyutian.util;

import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;

/**
 * Created by dyt on 2018/9/29.
 */
//文件上传连接  后期连接七牛云
public class UploadUtil {
    //返回该图片的访问地址
    public static String upload(MultipartFile file) throws IOException {
            //测试:先存在这个地方
        File Img = new File("E:\\hiwodyt\\hiwodyt\\target\\classes\\static\\upload\\"+file.getOriginalFilename());
        file.transferTo(Img);
        return "/upload/"+file.getOriginalFilename();
    }
}
